Skip to content

test(v3): constraints suite for eql_v3 encrypted-domain columns#310

Merged
tobyhede merged 5 commits into
eql_v3from
v3-encrypted-domain-constraints
Jun 21, 2026
Merged

test(v3): constraints suite for eql_v3 encrypted-domain columns#310
tobyhede merged 5 commits into
eql_v3from
v3-encrypted-domain-constraints

Conversation

@tobyhede

Copy link
Copy Markdown
Contributor

What

Salvaged from a local-only WIP branch (eql_v3-wip), the genuinely-new, non-superseded subset of that work:

  • tests/sqlx/tests/encrypted_domain/constraints.rs (+254) — table-level SQL constraint coverage (UNIQUE / NOT NULL / FOREIGN KEY) on eql_v3 encrypted-domain columns, the v3 analogue of v2's constraint_tests.rs. Three #[sqlx::test]s seeded from the eql_v2_int4 fixture, asserting the constraints bind the raw jsonb payload (byte-identity), not semantic plaintext or the eq_term.
    • Wired via mod constraints; in encrypted_domain.rs, kept outside scalars:: so the matrix-inventory snapshot does not mis-read it as a scalar type (same rationale as signed / text_match).
  • src/v3/sem/ore_cllw/functions.sql — explanatory comment on the load-bearing ::text cast in eql_v3.compare_ore_cllw_term: a NULL-component composite must fall through to the RAISE (extractor-invariant violation) rather than silently returning NULL. Comment only — no behaviour change.
  • CHANGELOG.md — documents the already-shipped eql_v2.ore_block_u64_8_256 =/<> COMMUTATOR fix (feat: eql_v2_int4 variant family (v3) #239), which had landed on eql_v3 but was missing from the changelog.

Why

Fills a real gap on eql_v3 (constraint coverage for the encrypted-domain families) and captures two pieces of already-shipped-but-undocumented context. The rest of the WIP branch was either already on eql_v3 (the #303 doubles / cross-ciphertext suite, #306 fixtures), superseded (float design/plan docs — feature shipped via #299), or would have regressed eql_v3 if merged wholesale, so it was deliberately left behind.

Verification

  • Imports resolve at the eql_tests crate root (assert_db_error, fetch_fixture_payload, sql_string_literal); no compile-time query! macros — runtime-checked sqlx::query only.
  • Full compile + run is creds-gated (the SQLx suite requires mise run test:sqlx:prep to generate eql_v2_*.sql fixtures), so it runs here in CI.

Salvaged from local-only wip branch (eql_v3-wip), the genuinely-new,
non-superseded subset:

- tests: encrypted_domain/constraints.rs — UNIQUE / NOT NULL / FOREIGN KEY
  coverage on eql_v3 encrypted-domain columns (the v3 analogue of v2's
  constraint_tests.rs), plus its `mod constraints;` wiring in
  encrypted_domain.rs. Kept outside `scalars::` so the matrix-inventory
  snapshot does not mis-read it as a scalar type.
- docs: explanatory comment on the load-bearing `::text` cast in
  eql_v3.compare_ore_cllw_term (NULL-component composites must fall through
  to the RAISE, not silently return NULL). Comment only — no behaviour change.
- changelog: document the already-shipped eql_v2.ore_block_u64_8_256
  `=`/`<>` COMMUTATOR fix (#239), which was undocumented.
@coderabbitai

coderabbitai Bot commented Jun 21, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 8a5a9fc8-0f58-4718-913d-9b2d7a647fb0

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch v3-encrypted-domain-constraints

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

tobyhede added 4 commits June 21, 2026 14:45
sql_string_literal already wraps the value in single quotes and all call
sites interpolate as {lit}::jsonb (no surrounding quotes); the comment's
'{lit}'::jsonb implied double-quoting. Comment only — no behaviour change.

Review note: CHANGELOG #239 attribution for the ore_block COMMUTATOR fix
verified correct (clauses introduced in 601538f, merged via #239).
Every CI job runs mise-action, which installs the mise.toml tools. The
bootstrap tool `cargo:cargo-binstall = "latest"` used the cargo: backend,
compiling cargo-binstall from source. The latest cargo-binstall now pulls
vergen@10.0.0 (MSRV rustc 1.95), but the toolchain bootstrapping mise's
cargo backend on the runner is older, so the build fails with exit 101.
Because cargo-binstall bootstraps every other cargo tool (sqlx-cli,
cargo-nextest, cargo-expand), its failure cascades and `mise install`
exits 1 — taking down every workflow before any real work runs.

Switch to the registry name `cargo-binstall`, which mise resolves via the
aqua backend to a prebuilt binary (aqua:cargo-bins/cargo-binstall). A
prebuilt binary has no compiler/MSRV dependency; the downstream cargo:
tools are then fetched as prebuilt binaries through it.
… entry

The renamed domain is eql_v3.int4_ord_ore (post schema-namespace move),
matching the spelling used elsewhere in the same [Unreleased] section.
@tobyhede tobyhede merged commit 4c05486 into eql_v3 Jun 21, 2026
18 checks passed
@tobyhede tobyhede deleted the v3-encrypted-domain-constraints branch June 21, 2026 22:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant